package com.thinkgem.javamg.task;

import com.thinkgem.javamg.task.thread.PgatourThread;
import com.thinkgem.javamg.task.thread.SinaThread;
import com.thinkgem.javamg.task.thread.ToutiaoThread;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;


/**
 * 定时爬取任务
 */
@Service
@Lazy(false)
public class DataTask {

    @Scheduled(cron = "${craw.cron}")
    public void task() {
        //启动新浪爬取
        new SinaThread().start();

        //启动美巡赛爬取
        new PgatourThread().start();

        //启动今日头条爬取
        new ToutiaoThread().start();
    }

}

